package com.example.blogback.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("article")
@Schema(description = "文章实体类")
public class Article {
    @TableId(type = IdType.AUTO)
    @Schema(description = "文章ID")
    private Long id;
    
    @Schema(description = "文章标题")
    private String title;
    
    @Schema(description = "分类ID")
    private Long categoryId;
    
    @Schema(description = "封面图片URL")
    private String coverImage;
    
    @Schema(description = "是否为精选文章")
    private Boolean featured;
    
    @Schema(description = "浏览次数")
    private Integer viewCount;
    
    @TableLogic
    @Schema(description = "是否已删除")
    private Boolean deleted;
    
    @Schema(description = "创建时间")
    private LocalDateTime createTime;
    
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;
}